<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>任务管理</title>
        <link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/platform.css" />
        <link rel="stylesheet" href="css/table.css" />
        <link rel="stylesheet" href="js/ui/jquery-ui.min.css" />
        <link rel="stylesheet" href="css/task-manage.css" />
    </head>

    <body>
        <div class="header">
            <div class="u-title">任务管理</div>
        </div>
        <div class="task-manage" ms-controller="mainController">
            <div class="u-multiform search-param">
                <div class="column"><!-- 
                    <div class="cell">
                        <label>任务类型：</label>
                        <select ms-duplex="taskType">
                            <option value="">全部</option>
                            <option value="1">总部任务</option>
                            <option value="2">大区任务</option>
                        </select>
                    </div> -->
                    <div class="cell">
                        <label>任务时间：</label>
                        <div class="cnt-box">
                            <input class="u-ipt ipt-datepicker" type="text" id="starttime" ms-duplex="taskStartTime" />
                            <span class="split">-</span>
                            <input class="u-ipt ipt-datepicker" type="text" id="endtime" ms-duplex="taskEndTime" />
                        </div>
                    </div>
                    <div class="cell">
                        <label>任务状态：</label>
                        <select ms-duplex="taskStatus">
                            <option value="">全部</option>
                            <option value="0">未开始</option>
                            <option value="1">进行中</option>
                            <option value="2">已结束</option>
                            <option value="99">已禁用</option>
                        </select>
                        <button class="u-btn small" ms-click="search">查询</button>
                    </div>
                </div>
            </div>
            <div class="add">
                <button class="u-btn small" ms-click="addTask()">新增</button>    
            </div>
            <div id="taskTable" ms-controller="taskTable"></div>
            <script type="avalon" id="tableTask">
                <div class="tableWrapper">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>任务ID</th>
                                <th>库位</th>
                                <th>品类</th>
                                <th>任务时间</th>
                                <th>操作人</th>
                                <th>操作时间</th>
                                <th>任务状态</th>
                                <th>任务类型</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ms-repeat-row="sources">
                                <td>{{row.taskId}}</td>
                                <td>{{row.storage}}</td>
                                <td>{{row.categoryName | truncate(8,"...")}}</td>
                                <td>{{row.taskStartTime | date("yyyy-MM-dd")}} ~ {{row.taskEndTime | date("yyyy-MM-dd")}}</td>
                                <td>{{row.taskOperator}}</td>
                                <td>{{row.operateTime}}</td>
                                <td>
                                    <span ms-if="row.validStatus==0">已禁用</span>
                                    <span ms-if="row.validStatus==1">{{row.taskStatus | filterTaskStatus}}</span>
                                </td>
                                <td>{{row.taskType==1?"总部":"大区"}}</td>
                                <td class="operate">
                                    <a ms-if="row.taskStatus != 2" href="javascript:;" ms-click="enablePop(row)">{{row.validStatus==0?"启用":"禁用"}}</a>
                                    <a ms-if="row.taskStatus == 0" ms-attr-href="editTask.html?pageType=1&taskId={{row.taskId}}">修改</a>
                                     <!--<a ms-if="row.taskStatus != 0" ms-attr-href="editTask.html?pageType=0&taskId={{row.taskId}}">查看任务</a>-->
                                    <a ms-if="row.taskStatus == 0" href="javascript:;" ms-click="delPop(row.taskId)">删除</a>
                                    <a ms-if="row.taskStatus != 0" ms-attr-href="taskDetail.html?taskId={{row.taskId}}">盘点明细</a>
                                    <!--<a ms-attr-href="undistributedTask.html?taskId={{row.taskId}}">查看未分配</a>-->
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="9">
                                    <div class="pager">
                                        <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                        <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                        <div class="current-page">
                                            第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage" />页
                                            <span class="totalpage">共 {{totalpage}} 页</span>
                                        </div>
                                        <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                        <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                        <div class="messageinfo">{{startrow}}-{{endrow}} 共{{total}}条</div>
                                    </div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </script>
        </div>
        <!--弹框区域-->
        <div ms-controller="popController">
            <div class="u-popup" id="popup_confirm">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="warning"></div>
                                <p ms-if="confirmType=='del'">确定要删除该任务吗？</p>
                                <p ms-if="confirmType!='del'">确定要{{confirmType=='enable'?'启用':'禁用'}}该任务吗？</p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn" ms-click="confirmSure()">确定</button>
                                <button class="u-btn gray btn-close">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="u-popup" id="popup_tips">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="error"></div>
                                <p></p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn btn-close">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="loadData"></div>
        <script src="js/jquery.min.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/swift-ui-table-1.1.js"></script>
        <script src="js/ui/jquery-ui.min.js"></script>
        <script src="js/ui/jquery-ui-timepicker-addon.js"></script>
        <script src="js/jquery.ztree.all-3.5.min.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script src="js/task-manage.js"></script>
    </body>

</html>